package czk.jvm.lecture.classloader;

public class MyTest9 {
    public static void main(String[] args) throws ClassNotFoundException {
        //获得系统类加载器
        ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();
        //loadclass不会导致类的初始化
        Class<?> aClass = systemClassLoader.loadClass("czk.jvm.lecture.classloader.D");
        System.out.println("========");
        //反射是对类的主动使用，会导致类的初始化
        Class<?> aClass1 = Class.forName("czk.jvm.lecture.classloader.D");
        boolean equals = aClass.equals(aClass1);
        System.out.println(equals);
    }
}
class D{
    static {
        System.out.println("DDDD");
    }
}
